<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>实现带左右按钮控制焦点图片切换</title>
<style type="text/css">
*{margin:0;padding:0;}
ul,li{list-style:none;}
img{border:0;}
.wrapper{
	width: 800px;
	margin: 0 auto;
	padding-bottom: 50px;
}
#focus{
	width: 800px;
	height: 280px;
	overflow: hidden;
	position: relative;
}
#focus ul{
	height: 380px;
	position: absolute;
}
#focus ul li{
	float: left;
	width: 800px;
	height: 280px;
	overflow: hidden;
	position: relative;
	background: #000;
}
#focus ul li div{
	position: absolute;
	overflow: hidden;
}
#focus .preBtn{
	width: 45px;
	height: 100px;	
	left: 0;
	top:90px;
	background:url(images/spirte.png) no-repeat 0 0;
	background-color:#000;
	cursor: pointer;
	opacity:0.4;
	filter:alpha(opacity=40);
}
#focus .nextBtn{
	width: 45px;
	height: 100px;
	right:0px;
	top:90px;
	background:url(images/spirte.png) no-repeat right top;
	background-color:#000;
	cursor: pointer;	
	opacity:0.4;
	filter:alpha(opacity=40);}

</style>

<script type="text/javascript">

	// 构建数组，存放图片地址
	var arr = new Array();
	arr[0] = "images/01.jpg";  // 0下标对应第一个位置的元素
	arr[1] = "images/02.jpg";
	arr[2] = "images/03.jpg";
	arr[3] = "images/04.jpg";
	arr[4] = "images/05.jpg";
	

	var timer,index=0;	
	window.onload=showPic;  

	// 展示图片
	function showPic(){
		
	}

	function showNext()
	{
		
		
		
	}

	function showPre()
	{
		
		
	}

	function showPrepic()
	{		
		
	}
</script>
</head>

<body>
<div class="wrapper">
  <div id="focus">
    <ul>
      <li><a href="#" target="_blank"><img src="images/01.jpg" alt="" id="pic"/></a>
      <div class="preBtn" onclick="showPre()"></div>
      <div class="nextBtn" onclick="showNext()"></div> 
      </li>      
    </ul>     
  </div>
</div>
</body>
</html>